using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace MecRobGest.GUI
{
    public partial class GUITrabajadoresOT : Form
    {
        public GUITrabajadoresOT()
        {
            InitializeComponent();
        }

        private void operarioOTBindingNavigatorSaveItem_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.operarioOTBindingSource.EndEdit();
            this.operarioOTTableAdapter.Update(this.dBDataset.OperarioOT);

        }

        private void GUITrabajadoresOT_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'dBDataset.Maquinas' table. You can move, or remove it, as needed.
            this.maquinasTableAdapter.Fill(this.dBDataset.Maquinas);
            // TODO: This line of code loads data into the 'dBDataset.OrdenesTrabajo' table. You can move, or remove it, as needed.
            this.ordenesTrabajoTableAdapter.Fill(this.dBDataset.OrdenesTrabajo);
            // TODO: This line of code loads data into the 'dBDataset.Trabajadores' table. You can move, or remove it, as needed.
            this.trabajadoresTableAdapter.Fill(this.dBDataset.Trabajadores);
            // TODO: This line of code loads data into the 'dBDataset.OperarioOT' table. You can move, or remove it, as needed.
            this.operarioOTTableAdapter.Fill(this.dBDataset.OperarioOT);
            // TODO: This line of code loads data into the 'dBDataset.OrdenesTrabajo' table. You can move, or remove it, as needed.
            this.ordenesTrabajoTableAdapter.Fill(this.dBDataset.OrdenesTrabajo);
            // TODO: This line of code loads data into the 'dBDataset.Trabajadores' table. You can move, or remove it, as needed.
            this.trabajadoresTableAdapter.Fill(this.dBDataset.Trabajadores);
            // TODO: This line of code loads data into the 'dBDataset.Maquinas' table. You can move, or remove it, as needed.
            this.maquinasTableAdapter.Fill(this.dBDataset.Maquinas);
            // TODO: This line of code loads data into the 'dBDataset.OperarioOT' table. You can move, or remove it, as needed.
            this.operarioOTTableAdapter.Fill(this.dBDataset.OperarioOT);

        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Validate();
            this.operarioOTBindingSource.EndEdit();
            this.operarioOTTableAdapter.Update(this.dBDataset.OperarioOT);
            this.Dispose();
        }

        private void operarioComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {

        }

        private void operarioOTBindingNavigatorSaveItem_Click_1(object sender, EventArgs e)
        {
            this.Validate();
            this.operarioOTBindingSource.EndEdit();
            this.operarioOTTableAdapter.Update(this.dBDataset.OperarioOT);

        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            try{
                operarioTextBox.Text = comboBox1.SelectedValue.ToString();
            }catch(Exception err){

            }
        }

        private void operarioTextBox_TextChanged(object sender, EventArgs e)
        {
            int iSelItem = 0;
            try{
                int.TryParse(operarioTextBox.Text,out iSelItem);
                comboBox1.SelectedValue = iSelItem;
            }catch(Exception err){

            }
        }

        private void maquinaTextBox_TextChanged(object sender, EventArgs e)
        {
            int iSelItem = 0;
            try{
                int.TryParse(maquinaTextBox.Text,out iSelItem);
                comboBox3.SelectedValue = iSelItem;
            }catch(Exception err){

            }
        }

        private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
        {
            try{
                maquinaTextBox.Text = comboBox3.SelectedValue.ToString();
            }catch(Exception err){

            }
        }

        private void oTTextBox_TextChanged(object sender, EventArgs e)
        {
            int iSelItem = 0;
            try{
                int.TryParse(oTTextBox.Text,out iSelItem);
                comboBox2.SelectedValue = iSelItem;
            }catch(Exception err){

            }
        }

        private void comboBox2_SelectedIndexChanged(object sender, EventArgs e)
        {
            try{
                oTTextBox.Text = comboBox2.SelectedValue.ToString();
            }catch(Exception err){

            }
        }

        private void bindingNavigatorMoveNextItem_Click(object sender, EventArgs e)
        {

        }
    }
}